package com.eee.machine.controller.web;


import com.eee.machine.common.MsgPushEntity;
import com.eee.machine.service.IMachineService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

@RestController
@RequestMapping("/web/machine")
public class MachineManagerController {

    @Autowired
    private IMachineService machineService;

    @RequestMapping("/malfunction")
    public Callable<JSONObject> malfunction(String machineId, String errorCode){
        return ()->{
            return machineService.malfunction(machineId, errorCode);
        };
    }


    @RequestMapping("/getOrder")
    public Callable<JSONObject> getOrder(String machineId){
        return ()->{
            return machineService.getOrder(machineId);
        };
    }


    @RequestMapping("/updateOrder")
    public Callable<JSONObject> updateOrder(String machineId, String tradeNo, Integer state, Integer lineSort, Integer count){
        return ()->{
            return machineService.updateOrder(machineId, tradeNo, state, lineSort, count);
        };
    }


}
